<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>    
    <title>Edit Role</title>    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<style type="text/css">
		.errorMessage{
			color:red;
			font-size: 13px;
		}
	</style>
  </head>
  
  <body style="text-align: center;margin: 0 auto; margin-top: 30px;">
  <s:form action="editRole" namespace="/control/sysmanage" validate="true">
  	<s:hidden name="role.roleId" />
  	<s:fielderror></s:fielderror>
    <table>
    	<tr>
    		<td>
    			角色名称：
    		</td>
    		<td>
    			<s:textfield name="role.name" value="%{role.name}" ></s:textfield>
    		</td>
    	</tr>
    	<tr>
    		<td>
    			角色描述
    		</td>
    		<td>    			
    			<s:textarea name="role.description" rows="4" cols="50" value="%{role.description}"></s:textarea>
    		</td>
    	</tr>
    	<tr>
    		<td>权限</td>
    		<td>
	    		<s:iterator	value="privileges" status="privilege" >
	    			<s:if test="#privilege.index % 5 == 0"><br/></s:if>
	    			<input type="checkbox" value="${id}" name="privileges.id" 
		    			<s:iterator value="role.privileges" status="st" >	    				
		    				<s:if test="id==#request.privileges.get(#privilege.index).id">checked="checked"</s:if>
		    			</s:iterator>
	    			/>${name}
	    		</s:iterator>
    		</td>
    	</tr>
    	<tr>
    		<td><input type="submit" value="修改" /></td>
    		<td><input type="reset" value="重置" /></td>
    	</tr>
    </table>
  </s:form>
  </body>
</html>
